package com.example.controller;




import com.example.entity.AliPay;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: demo1
 * @description:
 * @author: 诸葛龙辰
 * @create: 2022-11-15 23:09
 **/
@RestController
public class Hellocontroller {
    @GetMapping("/hello")
    public Map<String,Object> hello(){
        Map<String,Object> map = new HashMap<>();
        map.put("name","野猪佩奇");
        map.put("age",18);
        return map;
    }

    @Autowired
    private AliPay aliPay;
    @GetMapping("/index")
    public AliPay index(){
        return aliPay;
    }

    @Value("${server.port}")
    private Integer port;

    @GetMapping("info")
    public String info(){
        return "服务器的端口号"+port;
    }
}
